<template>
    <div class="taskcontrol">
        <wtop></wtop>
        <div class="center">
            <div class="right">
                <!-- <div class="where">当前位置：外呼系统><router-link to="/callsystem/taskControl">任务管理</router-link></div> -->

                <div style="height: 16px; width: 100%; background: #EFEFEF;"></div>
                <!-- <div class="topTag">
                  <div class="topLogo"><img :src="srclogo">管理中心</div>
                  <div class="powertop">
                    <router-link class="powertopli" to="/callsystem/taskReport">数据报表</router-link>
                    <router-link class="powertopli" to="/callsystem/personReport">人员报表</router-link>
                    <router-link class="powertopli powertopact" to="/callsystem/taskControl">任务管理</router-link>
                  </div>
                </div> -->

                <div class="team">
                  <div class="powertop">
                    <div :class="formInline.is_finish == 1?'acts powertopli':'powertopli'" @click="change(1)">进行中的任务</div>
                    <div :class="formInline.is_finish == 2?'acts powertopli':'powertopli'" @click="change(2)">已完成的任务</div>
                  </div>
                </div>

                <div class="conlist" v-loading='loading'>
                    <div class="flex">
                        <div class="gong gl">
                          <el-form :inline="true" :model="formInline">
                          <el-form-item label="任务名称">
                            <el-input v-model="formInline.name" placeholder="任务名称"></el-input>
                            </el-form-item>
                              <el-form-item label="任务类型">
                            <el-select clearable v-model="formInline.type" placeholder="请选择">
                             <el-option
                               v-for="(item,index) in taskTypeList"
                               :key="index"
                               :label="item.name"
                               :value="item.type">
                             </el-option>
                            </el-select>
                            </el-form-item>
                              <el-form-item label="创建时间">
                            <el-date-picker
                            v-model="formInline.createtime"
                            type="date"
                            value-format="yyyy-MM-dd"
                            placeholder="创建时间"></el-date-picker>
                            </el-form-item>
                            <el-form-item>
                            <el-button type="danger" round @click="search">检索</el-button>
                            </el-form-item>
                            </el-form>
                        </div>
                    </div>
                    <div class="flex">
                        <div class="gong gl">
                            <el-button type="danger" round @click="createdTask">按导入数据发布任务</el-button>
                            <el-button type="danger" round @click="releasetask=true">创建敢探号订单外呼任务</el-button>
                            <el-button type="text" @click="dload2">下载导入结果模板</el-button>
                        </div>

                    </div>
                    <div class="list">

                        <div class="th">任务名称</div>
                        <div class="th">创建时间</div>
                        <div class="th">任务类型</div>
                        <!-- <div class="th">数量</div> -->
                        <div class="th">外呼目标</div>
                        <div class="th">截止时间</div>
                        <div class="th td2">操作</div>
                    </div>
                    <div class="list" v-for="(item,index) in list" :key="index">

                        <div class="td">{{item.name}}</div>
                        <div class="td">{{item.created_at}}</div>
                        <div class="td">{{item.type_name}}</div>
                        <!-- <div class="td">{{item.count}}</div> -->
                        <div class="td">{{item.aim}}</div>
                        <div class="td">{{item.end_time}}</div>

                        <div class="td td2" style="justify-content: center; display: flex;">
                            <el-button type="text" @click="detail(item.id)">详情</el-button>
                            <div @click="importId(item.id)" style="display: inline-block;">
                              <upload-excel-component @on-selected-file="exportData" class="btnp" :buttonName="export_data"></upload-excel-component>
                            </div>
                            <el-button style="margin-left: 10px;" type="text" @click="deltask(item.id)">删除</el-button>
                            <el-button style="margin-left: 10px;" type="text" v-if="formInline.is_finish == 1" @click="wancheng(item.id)">已完成</el-button>
                        </div>
                    </div>
                    <el-pagination background layout="total,prev,pager,next" style="text-align: right; padding: 20px;" prev-text="上一页" next-text="下一页" :current-page="page" @current-change="fanye"
                      :page-size="pagesize" :total="total"></el-pagination>

                </div>
            </div>
        </div>
        <el-dialog title="发布外呼任务" :visible.sync="releaseTask" width="800px"  @opened="showClick2" @closed="hideClick2"  @close="clearForm('sendform')" center :close-on-click-modal="false" :close-on-press-escape="false">
            <el-form :model="sendform" ref="sendform" :rules="rules" @submit.native.prevent label-width="100px">
              <div class="formflex">
                <el-form-item label="任务名称:" prop="name">
                  <el-input v-model="sendform.name"></el-input>
                </el-form-item>
                <div class="lineflex">
                  <el-form-item label="任务类型:" prop="type">
                    <el-select v-model="sendform.type" placeholder="请选择">
                      <el-option
                        v-for="(item,index) in taskTypeList"
                        :key="index"
                        :label="item.name"
                        :value="item.type">
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-button type="text" @click="taglog=true">定义类型</el-button>
                </div>
              </div>
              <div class="formflex">
                <el-form-item label="外呼目标:" prop="aim">
                  <el-input v-model="sendform.aim"></el-input>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="紧急程度:">
                  <el-select v-model="sendform.urgency" placeholder="请选择">
                    <el-option label="普通" value="1"></el-option>
                    <el-option label="较高" value="2"></el-option>
                    <el-option label="很高" value="3"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="任务执行人:" required>
                  <el-radio-group  v-model="radioP" @change="radioValue">
                    <el-radio label="1">按导入表格选择执行人</el-radio>
                    <el-radio label="2">自主选择执行人</el-radio>
                  </el-radio-group>
                  <el-tree v-if="selectP"
                    :data="treeList"
                    show-checkbox
                    node-key="id"
                    ref="tree"
                    :expand-on-click-node="false"
                    :check-on-click-node="true"
                    :props="defaultProps"
                    @check="handleCheck">
                  </el-tree>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="截止时间:" prop="endtime">
                  <el-date-picker v-model="sendform.endtime" type="date" value-format="yyyy-MM-dd" placeholder="选择时间"> </el-date-picker>
                </el-form-item>
              </div>
                <el-form-item label="上传数据:" class="listupload" required>
                  <upload-excel-component class="hehe" style="display: inline-block;margin-right: 10px;" @on-selected-file="exportData" :buttonName="btnname"></upload-excel-component>
                  <!-- <el-button type="primary" v-if="!uploading">已上传</el-button> -->
                  <el-button type="text" @click="dload1">下载上传表格模板</el-button>
                </el-form-item>
                <el-form-item label="话术要求:" prop="words">
<!--                  <el-input type="textarea" :rows="3" v-model="sendform.words"></el-input>-->
                  <div ref="editor3"></div>
                </el-form-item>
                <div class="formflex formsubmit">
                  <el-button type="danger" :loading="sendloading" @click="sendForm('sendform')">发布任务</el-button>
                </div>
            </el-form>

        </el-dialog>

        <el-dialog :title="moban.platform_name+'订单外呼任务'" :visible.sync="releasetask" width="800px" center @opened="showClick" @closed="hideClick" :close-on-click-modal="false" :close-on-press-escape="false">
            <div class="tag">
              <div :class="taskC ? 'tg ative': 'tg'" @click="taskC=true">依据筛选条件创建任务</div>
              <div :class="!taskC ? 'tg ative': 'tg'" @click="taskC=false">依据导入订单创建任务</div>
            </div>
            <el-form v-show="taskC" :model="postform" ref="postform" :rules="rules" @submit.native.prevent label-width="100px">
              <div class="formflex">
                <el-form-item label="任务名称:" prop="name">
                  <el-input v-model="postform.name"></el-input>
                </el-form-item>
                <div class="lineflex">
                  <el-form-item label="商品编码:">
                    <!-- <el-input v-model="postform.sku"></el-input> -->
                    <el-select v-model="postform.sku"  :reserve-keyword="true" multiple filterable collapse-tags placeholder="请选择商品编码">
                        <el-option  v-for="item in shangpinbianma" :key="item.id" :label="item.title" :value="item.fetch_code"></el-option>
                    </el-select>
                    <el-button type="primary" size="small" @click="quanxuan">{{quanxuanma}}</el-button>
                  </el-form-item>
                </div>
              </div>
              <div class="formflex">
                <el-form-item label="紧急程度:">
                  <el-select v-model="postform.urgency" placeholder="请选择">
                    <el-option label="普通" value="1"></el-option>
                    <el-option label="较高" value="2"></el-option>
                    <el-option label="很高" value="3"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex" style="justify-content: space-between;" v-if="shop_id == 50481 || shop_id == 304676">
                <el-form-item label="91粉加人任务:">
                  <el-select v-model="postform.is_add_user" placeholder="请选择">
                    <el-option label="否" :value="0"></el-option>
                    <el-option label="是" :value="1"></el-option>
                  </el-select>
                </el-form-item>

                <el-form-item label="关联短信任务" style=" width: 378px;">
                  <el-select v-model="postform.sms_task_id" placeholder="请选择">
                    <el-option :label="item.name" :value="item.id" v-for="item in duanxinlists" :key="item.id"></el-option>

                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="订单来源:">
                  <el-select v-model="postform.source" multiple collapse-tags :reserve-keyword="true" filterable clearable  placeholder="订单来源">
                      <el-option :label="item.source_name" :value="item.source_name" v-for="(item,index) in sourcelist" :key="index"></el-option>
                  </el-select>
                  <!-- <el-button size="small" type="primary" @click="laiyuanshow = true">新增</el-button> -->
                  <el-button size="small" type="primary" @click="goid('/setup/dingdanlaiyuan/dingdanlaiyuan')" style="height: 38px; padding: 0 15px !important; line-height: 38px;" >管理来源</el-button>
                </el-form-item>
                <div class="lineflex">
                <el-form-item label="订单状态:">
                  <el-select v-model="postform.status" multiple filterable collapse-tags clearable placeholder="订单状态">
                    <el-option :label="item.label" :value="item.value" v-for="(item,index) in peizhis.order_status" :key="index"></el-option>
                  </el-select>
                </el-form-item>
                </div>
              </div>
              <div class="formflex">
                  <el-form-item label="退款状态:">
                    <el-select v-model="postform.refund_status" clearable placeholder="退款状态">
                      <el-option label="正常" value="100">正常</el-option>
                      <el-option label="退款中" value="200">退款中</el-option>
                      <el-option label="退款成功" value="300">退款成功</el-option>
                    </el-select>
                  </el-form-item>
                <div class="lineflex">
                <el-form-item label="激活状态:">
                  <el-select v-model="postform.active_status" clearable placeholder="激活状态">
                    <el-option label="无" value="0">无</el-option>
                    <el-option label="已激活" value="100">已激活</el-option>
                    <el-option label="激活且充值" value="200">激活且充值</el-option>
                  </el-select>
                </el-form-item>
                </div>
              </div>
              <div class="formflex">
                  <el-form-item label="标旗:">
                    <el-select v-model="postform.color" clearable placeholder="标旗">
                      <el-option label="灰" value="0">
                        <span style="float: left">
                          <div class="color1"></div>
                        </span>
                        <span class="color1s">灰</span>
                      </el-option>
                      <el-option label="红" value="1">
                        <span style="float: left">
                          <div class="color2"></div>
                        </span>
                        <span class="color2s">红</span>
                      </el-option>
                      <el-option label="黄" value="2">
                        <span style="float: left">
                          <div class="color3"></div>
                        </span>
                        <span class="color3s">黄</span>
                      </el-option>
                      <el-option label="绿" value="3">
                        <span style="float: left">
                          <div class="color4"></div>
                        </span>
                        <span class="color4s">绿</span>
                      </el-option>
                      <el-option label="蓝" value="4">
                        <span style="float: left">
                          <div class="color5"></div>
                        </span>
                        <span class="color5s">蓝</span>
                      </el-option>
                      <el-option label="紫" value="5">
                        <span style="float: left">
                          <div class="color6"></div>
                        </span>
                        <span class="color6s">紫</span>
                      </el-option>
                    </el-select>
                  </el-form-item>
              </div>
              <!-- <div class="formflex">
                <el-form-item label="首充状态:">
                  <el-select v-model="postform.active_status" clearable placeholder="激活状态">
                    <el-option label="无" value="0">无</el-option>
                    <el-option label="已激活" value="100">已激活</el-option>
                    <el-option label="激活且充值" value="200">激活且充值</el-option>
                  </el-select>
                </el-form-item>
              </div> -->

              <div class="formflex">
                <el-form-item label="时间周期:" required>

                  <div class="timeBox">
                    <el-select v-model="postform.time_filter_type" clearable placeholder="排序方式">
                      <el-option label="按订单创建时间" value="created_at"></el-option>
                      <el-option label="按订单发货时间" value="platform_delivered_at"></el-option>
                    </el-select>
                    <el-radio-group  v-model="radioT" @change="radioTime">
                      <el-radio label="1">绝对时间周期</el-radio>
                      <el-radio label="2">相对时间周期</el-radio>
                      <el-radio label="3">最近时间周期</el-radio>
                      <el-alert
                        title="注：使用订单创建时间"
                        type="info"
                        show-icon
                        :closable="false">
                      </el-alert>
                    </el-radio-group>
                      <el-date-picker v-if="radioT=='1'" v-model="postform.time" value-format="yyyy-MM-dd HH:mm:ss" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" placeholder="选择日期时间"></el-date-picker>
                      <div class="relatvetime" v-if="radioT=='2'">
                        实时时间
                        <el-input v-model="postform.day1" onkeypress="return( /[\d]/.test(String.fromCharCode(event.keyCode)) )" maxlength="2"></el-input>
                        天前
                        <el-input v-model="postform.day2" onkeypress="return( /[\d]/.test(String.fromCharCode(event.keyCode)) )" maxlength="2"></el-input>
                        天内的订单
                      </div>
                      <div class="relatvetime" v-if="radioT=='3'">
                        <el-input v-model="postform.day3" onkeypress="return( /[\d]/.test(String.fromCharCode(event.keyCode)) )" maxlength="2"></el-input>
                        天内的订单
                      </div>
                        <div style="margin-top: 10px;line-height: 1.2;color: #909399;">
                          注：相对时间周期是按照现实的时间向前推算一段周期的，统计的数据一直随实时变化。通常用于激活
                          和充值的外呼，例：总是筛选实时时间的10天前发货且30天内下单；激活状态为未激活状态的用户外呼。
                        </div>
                  </div>
                </el-form-item>
              </div>
                <el-form-item label="话术要求:">
                  <div ref="editor"></div>
                </el-form-item>
                <div class="formflex formsubmit">
                  <el-button type="danger" :loading="sendloading" @click="postForm('postform')">发布任务</el-button>
                </div>
            </el-form>

            <el-form v-show="!taskC" :model="sendformtask" ref="sendformtask" :rules="rules" @submit.native.prevent label-width="120px">
              <div class="formflex">
                <el-form-item label="任务名称:" prop="name">
                  <el-input v-model="sendformtask.name"></el-input>
                </el-form-item>
                <div class="lineflex">
                  <el-form-item label="任务类型:" prop="type">
                    <el-select v-model="sendformtask.type" placeholder="请选择">
                      <el-option
                        v-for="(item,index) in taskTypeList"
                        :key="index"
                        :label="item.name"
                        :value="item.type">
                      </el-option>
                    </el-select>
                  </el-form-item>
                  <el-button type="text" @click="taglog=true">定义类型</el-button>
                </div>
              </div>
              <div class="formflex" v-if="shop_id == 50481 || shop_id == 304676">
                <el-form-item label="91粉加人任务:">
                  <el-select v-model="sendformtask.is_add_user" placeholder="请选择">
                    <el-option label="否" :value="0"></el-option>
                    <el-option label="是" :value="1"></el-option>
                  </el-select>
                </el-form-item>
                <el-form-item label="关联短信任务" style=" width: 378px;">
                  <el-select v-model="sendformtask.sms_task_id" placeholder="请选择">
                    <el-option :label="item.name" :value="item.id" v-for="item in duanxinlists" :key="item.id"></el-option>

                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="紧急程度:">
                  <el-select v-model="sendformtask.urgency" placeholder="请选择">
                    <el-option label="普通" value="1"></el-option>
                    <el-option label="较高" value="2"></el-option>
                    <el-option label="很高" value="3"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="订单数据库:">
                  <el-select v-model="sendformtask.is_old" placeholder="请选择数据库">
                    <el-option label="最近的订单（6个月内订单）" value="0"></el-option>
                    <el-option label="历史订单（6个月之前的订单）" value="1"></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="商品编码:">
                  <el-select v-model="sendformtask.goods_sku" filterable clearable placeholder="请选择商品">
                    <el-option :label="item.title + '---' + item.fetch_code" :value="item.id"  v-for="item in shangpinlist" :key="item.id" ></el-option>
                    </el-option>
                  </el-select>
                </el-form-item>
              </div>
              <div class="formflex">
                <el-form-item label="创建订单来源:">
                  <el-select v-model="sendformtask.channel_class" clearable filterable placeholder="请选择来源渠道分类" @change="getlaiyuan">
                    <el-option :label="item.channel_name" :value="item.id"  v-for="item in qudaolists" :key="item.id" ></el-option>
                  </el-select>
                  <el-select v-model="sendformtask.source" clearable filterable placeholder="请选择订单来源" v-if="sendformtask.channel_class">
                    <el-option :label="item.source_name" :value="item.id"  v-for="item in qudaolaiyuanlists" :key="item" ></el-option>
                  </el-select>
                </el-form-item>
              </div>
              <!-- <div class="formflex">
                <el-form-item label="截止时间:" prop="endtime">
                  <el-date-picker v-model="sendformtask.endtime" type="date" value-format="yyyy-MM-dd" placeholder="选择时间"> </el-date-picker>
                </el-form-item>
              </div> -->
                <el-form-item label="上传数据:" class="listupload" required>
                  <upload-excel-component style="display: inline-block;margin-right: 10px;" @on-selected-file="exportData" :buttonName="btnname"></upload-excel-component>
                  <!-- <el-button type="primary" v-if="!uploading">已上传</el-button> -->
                  <el-button type="text" @click="dload3">下载上传表格模板</el-button>
                </el-form-item>
                <el-form-item label="话术要求:">
                  <div ref="editor2"></div>
                </el-form-item>
                <div class="formflex formsubmit">
                  <el-button type="danger" :loading="sendloading" @click="sendFormTask('sendformtask')">发布任务</el-button>
                </div>
            </el-form>

        </el-dialog>

        <el-dialog title="自定义任务类型" :visible.sync="taglog" width="400px">
        	  <div class="protag">
        		  <el-tag :key="index" v-for="(item,index) in taskTypeList" closable :disable-transitions="false" @close="handleClose(item)">{{item.name}}</el-tag>
        			<el-input class="input-new-tag" v-if="inputVisible" v-model="inputValue" ref="saveTagInput" size="small" @keyup.enter.native="handleInputConfirm" @blur="handleInputConfirm">
        			</el-input>
        			<el-button v-else class="button-new-tag" size="small" @click="showInput">输入自定义名称</el-button>
        	  </div>
        	  <span slot="footer" class="dialog-footer">
        		<el-button @click="dialogVisible = false">取 消</el-button>
        		<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
        	  </span>
        </el-dialog>
        <el-dialog title="导入提示" :visible.sync="error_log" width="400px">
          <el-alert
            :title="error_data"
            type="error"
            show-icon
            :closable="false">
          </el-alert>
        </el-dialog>
        <el-dialog title="添加来源" :visible.sync="laiyuanshow" :close-on-press-escape="false" :close-on-click-modal="false" width="600px">
            <div>
                <el-form ref="form" @submit.native.prevent  label-width="0px" class="form">
                  <el-form-item >
                      <el-input v-model="tuiguanglaiyuan.source" style="width: 250px;" placeholder="来源分类：例：“PDD”或“新媒体”"></el-input>
                      -
                      <el-input v-model="tuiguanglaiyuan.name" style="width: 250px;" placeholder="来源名称：例：”百度、搜狗”等"></el-input>

                  </el-form-item>
                </el-form>
            </div>
            <span slot="footer" class="dialog-footer">
              <el-button @click="laiyuanshow = false">取 消</el-button>
              <el-button type="primary" @click="tianjia">确 定</el-button>
            </span>
        </el-dialog>
        <el-dialog title="完成确认" center :visible.sync="wanchenglog" :close-on-press-escape="false" :close-on-click-modal="false" width="400px">
            <div style="text-align: center;">
               确认将该任务修改为已完成么？
            </div>
            <span slot="footer" class="dialog-footer">
              <el-button type="danger" round @click="wanchenggo">确认</el-button>
              <el-button type="info" round @click="wanchenglog = false">取消</el-button>
            </span>
        </el-dialog>
        <wfoot></wfoot>
    </div>

</template>

<script>
    import axios from 'axios'
    import wtop from '@/components/callsystem/wtop.vue'
    import wfoot from '@/components/callsystem/wfoot.vue'
    import moment from "moment";
    import UploadExcelComponent from "@/components/UploadExcel/index3.vue";
    import E from 'wangeditor'

    export default {
        components: {
            "wtop": wtop,
            "wfoot": wfoot,
            UploadExcelComponent
        },
        name: "taskControl",
        data() {
            return {
              laiyuanshow:false,
              sourcelist:"",
              tuiguanglaiyuan:{
                source:"",
                name:""
              },

              srclogo:"./static/img/wh_icon2.png",
                shoplog:false,
                shoplist:"",

                taglog: false,
                typelist:{},
                taglist:[],
                inputVisible: false,
                inputValue: '',

                radioP: '1',
                selectP: false,
                btnname:"+上传表格",
                uploading:true,
                formInline:{
                  name: '',
                  type: '',
                  createtime: '',
                  is_finish:1
                },
                sendform: {
                  name: '',
                  type: '',
                  aim: '',
                  group_ids: [],
                  endtime: '',
                  excel: [],
                  words: '',
                  urgency:'1'
                },
                releasetask: false,
                radioT: '',
                postform: {
                  name: '',
                  sku: '',
                  source: '',
                  status: [],
                  refund_status: '',
                  active_status: '',
                  color: '',
                  time: [],
                  day1: '',
                  day2: '',
                  day3: '',
                  words: '',
                  date1: '',
                  date2: '',
                  urgency:'1',
                  time_filter_type:'created_at',
                  is_add_user:"",
                  sms_task_id:""
                },


                taskTypeList:[],
                fanliuploadlog:false,
                uploadsuceess:"",
                uploadtimes:"",
                uploadmon1:"`",
                total:0,
                pagesize:20,
                page:1,
                list:[],
                loading:false,
                releaseTask: false,
                treeList: [],
                defaultProps: {
                  children: 'child',
                  label: 'name'
                },
                 rules: {
                  name: { required: true, message: '请输入任务名称', trigger: 'blur' },
                  type: { required: true, message: '请输入任务类型', trigger: 'change' },
                  aim: { required: true, message: '请输入外呼目标', trigger: 'blur' },
                  endtime: { required: true, message: '请输入截止时间', trigger: 'change' },
                  words: { required: true, message: '请输入话术要求', trigger: 'blur' },
                 },
                 idList: [],
                 export_data: '导入结果',
                 id: '',
                 checkStrictly: false,
                 url: '',
                 sendloading: false,

                taskC: true,
                sendformtask: {
                  name: '',
                  type: '',
                  // endtime: '',
                  excel: [],
                  words: '',
                  urgency:'1',
                  source:"",
                  channel_class:"",
                  is_add_user:0,
                  sms_task_id:""
                },
                error_log: false,
                error_data: '',
                shangpinbianma:"",
                quanxuanma:'全选',
                wanchenglog:false,
                task_id:"",
                qudaolists:"",
                qudaolaiyuanlists:"",
                shangpinlist:"",
                shop_id:"",
                duanxinlists:""
            }
        },
        created() {
          this.url = window.location.origin+"/91haoka_platform/"
          this.getmessagesource()
          this.getlist()
          this.getproductstype()

          axios.get('/api/plan-market/message/getrenwulist?order_status=-999&status=1')
            .then(response => {
              if (response.data.msg.code == 0) {
                this.duanxinlists = response.data.data.data
              } else {
                this.$message.error(response.data.msg.info);
              }
            })

          axios.get('/api/gth/user/shop')
          .then(response => {
              if(response.data.msg.code == 0){
                  this.shop_id = response.data.data.shop_id
              }else{
                  this.$message.error(response.data.msg.info);
              }
          })

          //获取商品编码
          var that = this;
          axios.get('/api/plan-market/all-pages?_page=1&_page_size=1000')
            .then(response => {
              if(response.data.msg.code == 0){
                that.shangpinbianma = response.data.data
              }else{
                if(response.data.msg.code == 50401){that.$router.push({ path: "/login" }); return false}
                that.$message.error(response.data.msg.info);
              }
            })

          //获取销售渠道
          axios.get('/api/form/channels?page_size=2000')
            .then(response => {
              if (response.data.msg.code == 0) {
                this.qudaolists = response.data.data.data
              } else {
                this.$message.error(response.data.msg.info);
              }
            })

          axios.get('/api/gth/order-pages2',{params:{
            status:100,
            _page:1,
            _page_size:1000
          }})
          .then(response => {
            if (response.data.msg.code == 0) {
              this.shangpinlist = response.data.data.data
            } else {
              this.$message.error(response.data.msg.info);
            }
          })


          //获取运营商渠道
          this.getlaiyuan()
        },
        mounted() {
        },
        watch:{
          'postform.sku': {
               handler: function(a,b) {
                 console.log(a.length)
                 console.log(this.shangpinbianma.length)
                 if(a.length != this.shangpinbianma.length){
                   this.quanxuanma = '全选'
                 }else{
                   this.quanxuanma = '全不选'
                 }
               },
           }
        },

        methods: {

          getlaiyuan:function(){
            this.sendformtask.source = ''
            axios.get('/api/form/channel/sources?channel_ids='+this.sendformtask.channel_class)
              .then(response => {
                if (response.data.msg.code == 0) {
                   this.qudaolaiyuanlists = response.data.data
                } else {
                   this.$message.error(response.data.msg.info);
                }
            })
          },
          wanchenggo:function(){
            axios.post('/api/plan-market/task/set',{task_id:this.task_id,is_finish:2})
            	.then(response => {
            		if(response.data.msg.code == 0){
                  this.$message.success('已设置完成');
                  this.getlist()
                  this.wanchenglog = false
            		}else{
            			this.$message.error(response.data.msg.info);
            		}
            	})
          },
          wancheng:function(id){
            this.wanchenglog = true
            this.task_id = id
          },
          change:function(val){
            this.formInline.is_finish = val
            this.getlist()
          },
          tianjia:function(){
            var that = this
            axios.post('/api/plan-market/out-store/add',{source:this.tuiguanglaiyuan.source,name:this.tuiguanglaiyuan.name})
            	.then(response => {
            		if(response.data.msg.code == 0){
                  that.$message.success('已添加');
                  that.laiyuanshow = false
                  that.getmessagesource()
            		}else{
            			that.$message.error(response.data.msg.info);
            		}
            	})
          },
          //获取来源
          getmessagesource:function(){
            var that = this
            axios.get("/api/form/channel/sources")
                .then(function(response) {
                    if (response.data.msg.code == 0) {
                        that.sourcelist = response.data.data
                    }else{
                        that.$message.error(response.data.msg.info);
                    }
                })
          },
          quanxuan:function(){
            let arr = []
            for(let i in this.shangpinbianma){
              arr.push(this.shangpinbianma[i].fetch_code)
            }
            if(arr.length == this.postform.sku.length){
              this.postform.sku = []
            }else{
              this.postform.sku = arr
            }
            console.log(this.postform.sku)
          },
          sendFormTask(formName){
            // console.log(this.sendformtask);
            var that = this
            this.$refs[formName].validate((valid) => {
              if (valid) {
                if(this.sendformtask.excel.length == 0){
                  that.$message.error('请上传表格');
                  return false;
                }
                that.sendloading = true
                var data = {}
                data.name = this.sendformtask.name
                // data.end_time = this.sendformtask.endtime
                data.type = this.sendformtask.type
                data.data = this.sendformtask.excel
                data.demand = this.sendformtask.words
                data.urgency = this.sendformtask.urgency
                data.is_old = this.sendformtask.is_old
                data.call_source = this.sendformtask.source
                data.channel_class = this.sendformtask.channel_class
                data.call_goods_sku = this.sendformtask.goods_sku
                data.is_add_user = this.sendformtask.is_add_user
                data.sms_task_id = this.sendformtask.sms_task_id



                axios.post("/api/plan-market/call/task/order_task_create", data)
                  .then(function(response) {
                    that.sendloading = false
                    that.error_data = response.data.data.message
                    if (response.data.msg.code == 0) {
                      that.releasetask = false
                      that.$refs[formName].resetFields();
                      that.sendformtask.excel = []
                      that.getlist()
                      if(that.error_data){
                        that.error_log = true
                      }
                    }else{
                        // that.$message.closeAll()
                        // that.$message({message:response.data.msg.info,type:'error',duration:0});
                        that.$message.error(response.data.msg.info)
                    }
                  })
              } else {
                return false;
              }
            })
          },
          hideClick() {//这里是解决富文本嵌套问题
            this.$refs.editor.innerHTML = ''
            this.$refs.editor2.innerHTML = ''

            this.$refs['postform'].resetFields();
            this.$refs['sendformtask'].resetFields();

          },
          hideClick2() {//这里是解决富文本嵌套问题
            this.$refs.editor3.innerHTML = ''
            this.$refs['sendform'].resetFields();
          },

          showClick(){
            var that = this
            var editor = new E(this.$refs.editor);
            editor.customConfig.menus = [
              'bold',
              'foreColor',
              'fontSize'
            ]
            editor.customConfig.onchange = function (html) {
            	that.postform.words = html
            }
            editor.create();

            var editor2 = new E(this.$refs.editor2);
            editor2.customConfig.menus = [
              'bold',
              'foreColor',
              'fontSize'
            ]
            editor2.customConfig.onchange = function (html) {
            	that.sendformtask.words = html
            }
            editor2.create();


          },
          showClick2(){
            var that = this
            var editor3 = new E(this.$refs.editor3);
            editor3.customConfig.menus = [
              'bold',
              'foreColor',
              'fontSize'
            ]
            editor3.customConfig.onchange = function (html) {
              that.sendform.words = html
            }
            editor3.create();
          },
          radioTime(){
            if(this.radioT == '1'){
              this.postform.day1 = ''
              this.postform.day2 = ''
              this.postform.day3 = ''
            }
            if(this.radioT == '2'){
              this.postform.time = []
              this.postform.day3 = ''
            }
            if(this.radioT == '3'){
              this.postform.time = []
              this.postform.day1 = ''
              this.postform.day2 = ''
            }
            this.postform.date1 = ''
            this.postform.date2 = ''
          },
          //订单发布
          postForm(formName){
            // console.log(this.sendform);
            var that = this
            this.$refs[formName].validate((valid) => {
              if (valid) {
                if(this.radioT == '1'){
                  this.postform.date1 = this.postform.time[0] ? this.postform.time[0] : ''
                  this.postform.date2 = this.postform.time[1] ? this.postform.time[1] : ''
                }
                if(this.radioT == '2'){
                  this.postform.date1 = this.postform.day1
                  this.postform.date2 = this.postform.day2
                  if((this.postform.date1 || this.postform.date2) && this.postform.date2 - this.postform.date1 <= 0){
                    that.$message.error('时间周期设置错误');
                    return false;
                  }
                  if(this.postform.date1 > 30 ||this.postform.date2 > 30){
                    that.$message.error('时间周期设置过长，最多30天内');
                    return false;
                  }
                }
                if(this.radioT == '3'){
                  this.postform.date1 = this.postform.day3
                  if(this.postform.date1 > 30){
                    that.$message.error('时间周期设置过长，最多30天内');
                    return false;
                  }
                }

                if(this.postform.date1.length == 0 && this.postform.date2.length == 0){
                  that.$message.error('请设置时间周期');
                  return false;
                }
                that.sendloading = true
                var data = {}
                data.name = this.postform.name
                data.fetch_code = this.postform.sku
                data.source = this.postform.source
                data.status = this.postform.status
                data.refund_status = this.postform.refund_status
                data.active_status = this.postform.active_status
                data.color = this.postform.color
                data.time_type = this.radioT
                data.date1 = this.postform.date1
                data.date2 = this.postform.date2
                data.demand = this.postform.words
                data.urgency = this.postform.urgency
                data.time_filter_type = this.postform.time_filter_type
                data.is_add_user = this.postform.is_add_user
                data.sms_task_id = this.postform.sms_task_id



                axios.post("/api/plan-market/call/task/order_task_create", data)
                  .then(function(response) {
                      if (response.data.msg.code == 0) {
                          that.releasetask = false
                          that.sendloading = false
                          that.getlist()
                      }else{
                          that.sendloading = false
                          that.$message.error(response.data.msg.info);
                      }
                  })
              } else {
                return false;
              }
            })
          },
          // radioTime(){
          //   this.radioTime  =='1'
          // },
          //删除任务
          deltask(id){
            var that = this
            this.$confirm('此操作将删除该任务，是否继续？', '提示', {
              confirmButtonText: '确定',
              cancelButtonText: '取消',
              type: 'warning'
            }).then(() => {
              axios.post('/api/plan-market/task/delete?task_id='+id).then(function(response) {
                if(response.data.msg.code == 0){
                  that.$message.success('删除成功！');
                  that.getlist()
                }else{
                	that.$message.error(response.data.msg.info);
                }
              })
            }).catch(() => {
            });
          },
          radioValue(){
            this.selectP = this.radioP =='1' ? false : true
          },
          //发布任务关闭
          clearForm(formName){
            this.$refs[formName].resetFields();
          },
          //下载模板
          dload1:function(){
            const a = document.createElement('a');
          	a.setAttribute('download', '上传表格模板.xlsx');
          	a.setAttribute('href', this.url+'static/uploadCreatedTask.xlsx');
          	a.click();
          },
          dload2:function(){
            const a = document.createElement('a');
          	a.setAttribute('download', '导入结果模板.xlsx');
          	a.setAttribute('href', this.url+'static/uploadImportResult.xlsx');
          	a.click();
          },
          dload3:function(){
            const a = document.createElement('a');
            a.setAttribute('download', '上传表格模板.xlsx');
            a.setAttribute('href', this.url+'static/uploadOrderCreatedTask.xlsx');
            a.click();
          },
          createdTask(){
            this.releaseTask = true
            this.btnname = "+上传表格"
            var that = this
            axios.get("/api/plan-market/groups/get")
              .then(function(response) {
            	  if(response.data.msg.code == 0){
                  that.treeList = response.data.data
                  // for(var i = that.treeList.length-1;i>0;i--){
                  //   if(that.treeList[i].child.length == 0){
                  //     that.treeList.splice(i,1)
                  //   }
                  // }
            	  }else{
            	  	that.$message.error(response.data.msg.info);
            	  }

              })
          },
          //详情
          detail(id){
            this.$router.push({
              path: "/callsystem/taskDetail",
              query: { id: id }
            })
          },
          //获取产品类型
          getproductstype:function(){
          	var that = this
          	axios.get("/api/plan-market/call/config/list")
          	  .then(function(response) {
          		  if(response.data.msg.code == 0){
                  that.taskTypeList = response.data.data
          		  }else{
          		  	that.$message.error(response.data.msg.info);
          		  }

          	  })
          },
          //自定义产品类型
          handleClose(tag) {
            // var that = this
            // for(let i in this.taskTypeList){
            //   if(this.taskTypeList[i].id == tag.id){
            //     if(i < this.taskTypeList.length-1){
            //       console.log(3);
            //       this.$message.error('');
            //     }
            //     else{
            //       console.log(2);
            //       axios.post('/api/plan-market/task/config/del',{id: tag.id})
            //       	.then(response => {
            //         if(response.data.msg.code == 0){
            //           that.getproductstype();
            //           that.$message({
            //             message: '删除成功',
            //             type: 'success'
            //           });
            //         }else{
            //           that.$message.error(response.data.msg.info);
            //         }
            //       })
            //     }
            //   }
            // }

          	// this.taglist.splice(this.taglist.indexOf(tag), 1);
            // console.log(this.taskTypeList);
          },
          showInput() {
          	this.inputVisible = true;
          	this.$nextTick(_ => {
          	  this.$refs.saveTagInput.$refs.input.focus();
          	});
          },
          handleInputConfirm() {
          	var that = this;
          	var formData = new FormData();
            this.inputValue = this.inputValue.replace( /^\s*/, '')
            if(this.inputValue.length == 0){
              this.inputVisible = false;
              return
            }
          	formData.append("name",this.inputValue);
          	axios.post('/api/plan-market/call/task/config',formData)
          		.then(response => {
          			if(response.data.msg.code == 0){
          				that.getproductstype();
          				that.$message({
          				  message: '添加成功',
          				  type: 'success'
          				});
          			}else{
          				that.$message.error(response.data.msg.info);
          			}
          		})
          	let inputValue = this.inputValue;
          	if (inputValue) {
          	  this.taglist.push(inputValue);
          	}
          	this.inputVisible = false;
          	this.inputValue = '';
          },
          //树形选择
          handleCheck(currNode,data){
            this.idList = data.checkedKeys
          },
          //去除父节点
          delfatherNode(){
            for(let i in this.idList) {
              this.treeList.forEach(item => {
                if(this.idList[i] == item.id){
                  item.child !== undefined ? this.idList.splice(this.idList.indexOf(item.id),1) : ''
                }
              })
              }
          },
          //发布任务
          sendForm(formName){
            // console.log(this.sendform);
            var that = this
            this.$refs[formName].validate((valid) => {
              if (valid) {
                if(this.selectP == false && !this.idList){
                  that.$message.error('请选择执行人');
                  return false;
                }
                if(this.sendform.excel.length == 0){
                  that.$message.error('请上传表格');
                  return false;
                }
                that.sendloading = true
                that.delfatherNode() //去除父节点id
                var data = {}
                data.name = this.sendform.name
                data.type = this.sendform.type
                data.aim = this.sendform.aim
                data.group_ids = this.idList
                data.end_time = this.sendform.endtime
                data.im_type = this.radioP
                data.data = this.sendform.excel
                data.demand = this.sendform.words
                data.urgency = this.sendform.urgency
                axios.post("/api/plan-market/call/task/create", data)
                  .then(function(response) {
                      if (response.data.msg.code == 0) {
                          that.releaseTask = false
                          that.sendloading = false
                          that.$refs[formName].resetFields();
                          that.getlist()
                      }else{
                          that.sendloading = false
                          that.$message.error(response.data.msg.info);
                      }
                  })
              } else {
                return false;
              }
            })
          },

            //获取导入详情
            // uploadx:function(){
            //     var that = this
            //     axios.get('/api/plan-market/rebate/import/logs?month='+this.uptime)
            //     	.then(response => {
            //     		if(response.data.msg.code == 0){
            //                 that.uploadsuceess = response.data.data[0].success
            //                 that.uploadtimes = response.data.data[0].times
            //     		}else{
            //     			that.$message.error(response.data.msg.info);
            //     		}
            //     	})
            // },
            search:function(){
              // console.log(this.formInline);
              this.page = 1
                this.getlist()
            },
            //翻页
            fanye:function(page){
            	this.loading = true
            	this.page = page
            	this.getlist()
            },
            //获取列表
            getlist:function(){
                var that = this
                this.loading = true
                if(this.formInline.createtime == null){
                  this.formInline.createtime = ''
                }
                axios.get('/api/plan-market/call/task/list?page='+this.page+'&page_size='+this.pagesize+'&created_at='+this.formInline.createtime+'&name='+this.formInline.name+'&type='+this.formInline.type+'&is_finish='+this.formInline.is_finish)
                	.then(response => {
                		if(response.data.msg.code == 0){
                            that.list = response.data.data.data
                            that.total = response.data.data.total
                            that.loading = false
                		}else{
                			that.$message.error(response.data.msg.info);
                		}
                	})
            },
            //下面使用的格式化时间
            formatDate:function(numb) {
              const time = new Date((numb - 1) * 24 * 3600000 + 1)
              time.setYear(time.getFullYear() - 70)
              const year = time.getFullYear() + ''
              const month = time.getMonth() + ''
              let date = time.getDate() + ''
              if(time.getFullYear()%4 === 0){
                var X = moment([year, month, date]).subtract(1, 'days').format('YYYY-MM-DD');
              }else{
                var X = moment([year, month, date]).format('YYYY-MM-DD');
              }
              return X
            },
            //导入
            exportData(data) {
                // this.uploading = false
                // this.shoplog = true
                var that = this;
                let list = [];
                if(data.header[1]=='*联系电话*'){
                //导入excel
                for (var i = 0; i < data.results.length; i++) {
                    var obj = {};
                    // console.log(data.results[i]["*业务ID*"])
                    if(data.results[i]["*业务ID*"] == undefined){
                      this.$message.error('解析失败，请仔细检查必填项是否有空值！');
                      return
                    }
                    if(data.results[i]["*业务ID*"] != undefined){
                        obj["mission_id"] = data.results[i]["*业务ID*"]
                    }

                    if(data.results[i]["*联系电话*"] != undefined){
                        obj["mobile"] = parseInt(data.results[i]["*联系电话*"])
                    }else{
                      obj["mobile"] = ''
                    }
                    if(data.results[i]["外呼执行人"] != undefined){
                        obj["caller_name"] = data.results[i]["外呼执行人"];
                    }else{
                      obj["caller_name"] = '';
                    }
                    if(data.results[i]["用户姓名"] != undefined){
                        obj["user_name"] = data.results[i]["用户姓名"];
                    }else{
                      obj["user_name"] = '';
                    }
                    if(data.results[i]["用户信息"] != undefined){
                      obj["user_info"] = data.results[i]["用户信息"];
                    }else{
                      obj["user_info"] = '';
                    }
                    if(data.results[i]["产品名"] != undefined){
                      obj["product"] = data.results[i]["产品名"];
                    }else{
                      obj["product"] = '';
                    }
                    if(data.results[i]["地址"] != undefined){
                      obj["address"] = data.results[i]["地址"];
                    }else{
                      obj["address"] = '';
                    }
                    if(data.results[i]["备注1"] != undefined){
                      obj["remark_one"] = data.results[i]["备注1"];
                    }else{
                      obj["remark_one"] = '';
                    }
                    if(data.results[i]["备注2"] != undefined){
                      obj["remark_two"] = data.results[i]["备注2"];
                    }else{
                      obj["remark_two"] = '';
                    }
                    if(data.results[i]["备注3"] != undefined){
                      obj["remark_three"] = data.results[i]["备注3"];
                    }else{
                      obj["remark_three"] = '';
                    }
                    // console.log(obj)
                    list.push(obj);
                }
                this.sendform.excel = list
                this.$message.success('表格上传成功！');
                this.btnname = '更新表格'
                // this.uploading = true

                }

                if(data.header[1]=='*目标达成*'){
                  //导入结果
                  for (var i = 0; i < data.results.length; i++) {
                      var obj = {};
                      if(data.results[i]["*业务ID*"] == undefined || data.results[i]["*目标达成*"] == undefined){
                        this.$message.error('解析失败，请仔细检查必填项是否有空值！');
                        return
                      }
                      if(data.results[i]["*业务ID*"] != undefined){
                          obj["mission_id"] = data.results[i]["*业务ID*"]
                      }
                      if(data.results[i]["*目标达成*"] != undefined){
                          obj["ok"] = data.results[i]["*目标达成*"];
                      }
                      // console.log(obj)
                      list.push(obj);
                  }
                  axios.post("/api/plan-market/task/result/import", {id: this.id,data: list})
                      .then(function(response) {
                      if (response.data.msg.code == 0) {
                          that.$message.success('导入成功！');
                      }else{
                          that.$message.error(response.data.msg.info);
                      }
                  })
                }

                if(data.header[1]!='*联系电话*' && data.header[1]!='*目标达成*'){
                //导入excel
                for (var i = 0; i < data.results.length; i++) {
                    var obj = {};
                    // if(data.results[i]["订单ID"] == undefined && data.results[i]["外部订单号"] == undefined) {
                    //   this.$message.error('解析失败，请仔细检查必填项是否有空值！');
                    //   return
                    // }
                    if(data.results[i]["订单ID"] != undefined){
                        obj["order_ids"] = data.results[i]["订单ID"]
                    }else{
                      obj["order_ids"] = ''
                    }

                    if(data.results[i]["外部订单号"] != undefined){
                        obj["source_ids"] = data.results[i]["外部订单号"]
                    }else{
                      obj["source_ids"] = ''
                    }

                    list.push(obj);
                }
                this.sendformtask.excel = list
                this.$message.success('表格上传成功！');
                this.btnname = '更新表格'

                }
            },

            importId(id){
              this.id = id
            }
        }
    }
</script>

<style lang="scss" scoped>
    .taskcontrol{ margin: 0; padding: 0; background: #EFEFEF;
        /deep/ .el-pagination.is-background .btn-prev:disabled{ background: rgba(246, 246, 246, 0.3); border: 1px rgba(167, 167, 167, 0.3) solid;}
        /deep/ .el-pagination.is-background .btn-next:disabled{ background: rgba(246, 246, 246, 0.3); border: 1px rgba(167, 167, 167, 0.3) solid;}
        /deep/ .el-pagination.is-background .btn-next{ background: rgba(246, 246, 246,1); border: 1px rgba(167, 167, 167,1) solid;}
        /deep/ .el-pagination.is-background .btn-prev{ background: rgba(246, 246, 246,1); border: 1px rgba(167, 167, 167,1) solid;}
        /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active{ background-color: #2974FF;}
        /deep/ .el-pagination.is-background .el-pager li:not(.disabled).active:hover {
            color: #fff;
        }
        /deep/ .el-pagination.is-background .el-pager li:not(.disabled):hover {
            color: #2974FF;
        }
        /deep/ .el-pager li{ border-radius: 14px; background: rgba(255, 255, 255, 1); border: 1px rgba(167, 167, 167, 0.3) solid;}
        /deep/ .btn-prev{ border-radius: 14px; padding: 0 10px;}
        /deep/ .btn-next{ border-radius: 14px; padding: 0 10px;}

        /deep/ .el-table th{ background: rgb(234, 234, 234); color: rgb(110, 110, 110);}
        /deep/ .el-input__inner{ line-height: 36px; height: 36px; font-size: 12px; background: rgb(247, 248, 250);  border: 0;}
        /deep/ .el-date-editor .el-range-input{ background: rgb(247, 248, 250); }
        /deep/ .el-button{ padding: 11px 23px !important;}
        /deep/ .el-button--text{ padding: 11px 5px !important;}
        /deep/ .el-button--mini{ padding: 6px 15px !important;}
        /deep/ .el-button--danger {
            color: #FFF;
            background-color: #2974FF;
            border-color: #2974FF;
        }
        .team {
          background: #F9F9F9;
        }

        .powertop {
          display: flex;
          width: 640px;
        }

        .powertopli {
          flex-basis: 160px;
          line-height: 60px;
          color: #727272;

          font-size: 14px; cursor: pointer;
          text-align: center;
        }

        .acts {
          background: #FFFFFF; position: relative;
          &::after{
            content: "";
            position: absolute;
            left: 50%;
            bottom: 0px;
            margin-left: -16px;
            width: 32px;
            height: 3px; border-radius: 2px;
            background: #2974FF;
          }
        }
        #drop{
            /deep/ .el-button--primary{ background: #ffffff !important; color: #409EFF !important; }
        }
        .listupload{ font-size: 14px;
            .li{flex: 1; line-height: 38px; margin-top: 20px;}


        }
        .center{ min-width: 1366px;width: 1366px; margin: 0 auto; display: flex; justify-content: space-between;
    		.right{ flex-basis: 1366px; background: #ECECEC;
                .title{border-bottom: 1px #EAEAEA solid;  line-height: 45px; padding-left: 30px; font-size: 16px; background: #F9F9F9; color: #727272}
                .topTag{display: flex;background: #fff;position: relative;border-bottom: #e2e0e3 1px solid;
                  .topLogo{ font-size: 20px; color: #707070;display: flex;align-items: center;padding: 14px 0;
                    img{ width: 30px;height: 30px;margin: 0 10px;}
                  }
                  .powertop{ display: flex; width: 100%;position: absolute;justify-content: center;}
                  .powertopli{ cursor: pointer;flex-basis: 120px; line-height: 50px;padding-top: 5px; border-bottom: 3px #F8F8F8 solid; color: #707070; font-size: 18px; text-align: center;}
                  .powertopact{border-bottom: 3px #4D4D4D solid;font-weight: bold;}
                }
            }
            .con{  background: #FFFFFF; padding: 30px 40px; display: flex; justify-content: space-between;
                .conleft{
                    .flex{ display: flex; margin-bottom: 20px;}
                    .gong{ margin-right: 30px; color: #333}
                }
                .conright{
                    .el-input__inner{ line-height: 40px !important; height: 40px !important;}
                }
            }
            .conlist{ padding: 30px; background: #FFFFFF;
                .flex{ display: flex; justify-content: space-between}
                .gong{ display: flex;
                    .el-date-editor.el-input{ width: 200px;}
                    .el-input__inner{ width: 250px;}
                    .el-button--danger{ margin-left: 20px;}
                    .el-button--primary{ padding: 10px 30px; background: #EEF7FF; border: 1px #EEF7FF solid; margin-left: 20px;}
                    .el-date-editor--month{ margin-right: 20px;}
                    /deep/ .el-form--inline .el-form-item{ margin-bottom: 0;}
                }
                .gl{ margin-bottom: 20px;
                    .el-input__inner{ width: 200px !important; }
                    .el-button--danger{ margin-left: 0px !important; margin-right: 20px;}
                }
                .ml{
                  .el-button--danger{ margin-left: 10px!important;}
                }
                .list{ display: flex; border-bottom: 1px #eaeaea solid; align-items: center;
                    .th{  background: rgb(234, 234, 234); color: rgb(110, 110, 110); text-align: center; flex: 1; padding: 15px 0; font-size: 14px;}
                    .td{ background: #ffffff; text-align: center; flex: 1; padding: 15px 0; font-size: 14px; }
                    .td2{
                      flex: 1.5;
                      .el-button{padding: 0;}
                    }
                }
                .el-pagination{ text-align: right; margin: 20px 0}
            }
    	}
      .formflex{display: flex;justify-content: space-between;
      .timeBox{
        background: #f4f4f5;padding: 10px 20px 20px;border-radius: 4px;border: 1px solid #DCDFE6;
        .el-alert{width: auto;display: inline-flex;}
        .el-date-editor--datetimerange{width: auto;}
        .relatvetime{
          display: flex;
          .el-input,.el-input__inner{ width: 100px !important; }
        }
      }
        .el-input__inner{ width: 200px; }
        .el-input{width: 100%!important;}
        .lineflex{display: flex;width: 378px;
          .el-button--text{height: 40px;margin-left: 20px;}
        }

      }

      .el-tree__empty-text{position: initial!important;}
      .formsubmit{justify-content: center;}
      .protag{
      	.el-tag{ margin-right: 20px; margin-bottom: 20px;}
      }

      .w-e-text-container{height: 100px!important;}
      .tag{
        display: flex;
        border-bottom: 1px solid #e8e8e8;
        margin-bottom: 20px;
        .tg{
          padding: 10px;
          border-bottom: 3px solid #ff6e6e00;
          color: #606266;
          cursor: pointer;
        }
        .ative{
          color: #FF7272;
          border-bottom: 3px solid #ff6e6e;
        }
      }
    }
</style>
